Apparatus and method of processing images in an electronic device

ABSTRACT

Disclosed are an apparatus and method of encoding and decoding color images in an electronic device which includes a controller that analyzes pixel data of an image, determines a pixel pattern, and encodes the image according to the determined pixel pattern, and a display that displays the image under the control of the controller.

PRIORITY

This application claims priority under 35 U.S.C. §119(a) to KoreanPatent Application No. 10-2014-0078722, filed in the Korean IntellectualProperty Office on Jun. 26, 2014, the contents of which are incorporatedherein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an apparatus and method of encoding anddecoding color images in an electronic device.

2. Description of the Related Art

Digital image data includes Red (R), Green (G), and Blue (B) colorcomponents or luminance (Y) and a plurality of color differencecomponents (chrominance (C)). Color difference components may beproduced from differences between the luminance signal (Y) representingthe brightness of a video on an electronic device and the three basiccolors signals, in which case the differences may be three colordifference components: (RY), (GY) and (BY). The three basic colors maybe reproduced by using the two color difference components, (RY) and(BY).

A digital image may be formed with a ratio of the luminance Y and thecolor difference components (B−Y and R−Y), 4:n:n, where the number, ‘4’denotes a sampling rate of a standard frequency 13.5 MHz, for convertinganalog TV signals into digital signals, and ‘n’ and ‘m’ denote therespective color difference components. There may be sampling schemesconsidering ratios of luminance and color difference components, e.g.,4:4:4, 4:2:2, and 4:1:1. The 4:4:4 scheme indicates that threecomponents channels are sampled at 13.5 MHz. The 4:2:2 scheme indicatesthat when the Y signal is sampled every line at 13.5 MHz, the colordifference signals are sampled every two lines at 6.75 MHz. The 4:1:1scheme indicates that when the Y signal is sampled every line at 13.5MHz, the color difference signals are sampled every four lines at 3.37MHz.

Conventional electronic devices reduce the rates of color differencecomponents to be less than the rate of a luminance component in adigital image including, for example, a luminance component, first colordifference component and second color difference component. As such, thenumber of color difference components is reduced compared to the rate ofthe luminance component. In that case, although the size of image datamay be reduced, the capability of displaying images also decreases.Accordingly, there is a need in the art for an improved method andapparatus for encoding and decoding images in an electronic device, suchthat the integrity of an image display is maintained.

SUMMARY OF THE INVENTION

The present invention has been made to address at least the problemsand/or disadvantages described above and to provide at least theadvantages described below.

Accordingly, an aspect of the present invention provides an apparatusand method that codes color difference data of pixels of a unit block,according to pixel patterns, when encoding a digital image that mayinclude a luminance component, first color difference component andsecond color difference component.

In accordance with an aspect of the present invention, an electronicdevice includes a controller that analyzes pixel data of an image,determines a pixel pattern, and encodes the image according to thedetermined pixel pattern, and a display, functionally connected to thecontroller, that displays the image.

In accordance with another aspect of the present invention, a method ofprocessing images in an electronic device includes analyzing pixel dataof an image and outputting the analyzed pixel data, determining a pixelpattern based on the analyzed pixel data, and encoding the imageaccording to the determined pixel pattern.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other aspects, features and advantages of the presentinvention will become more apparent from the following detaileddescription taken in conjunction with the accompanying drawings, inwhich:

FIG. 1 illustrates a network environment 100 including an electronicdevice 101 according to various embodiments of the present invention;

FIG. 2 illustrates a schematic block diagram of an electronic device forprocessing images according various embodiments of the presentinvention;

FIGS. 3A to 3D illustrate diagrams that describes configurations ofpixels for an image in an electronic device according to variousembodiments of the present invention;

FIG. 4 illustrates examples of a pattern of pixels in a unit block in anelectronic device according to various embodiments of the presentinvention;

FIG. 5 is a block diagram of an image-processing module for analyzingvalues of pixels in a unit block, determining the pixel pattern based onthe pixel analyses, and encoding color difference data according to thedetermined pixel pattern in an electronic device according to variousembodiments of the present invention;

FIG. 6 illustrates a configuration of pixels in a unit block in anelectronic device according to various embodiments of the presentinvention;

FIGS. 7A to 7C illustrate a process of analyzing values of pixels in aunit block in an electronic device according to various embodiments ofthe present invention;

FIG. 8 illustrates patterns of a unit block according to analyzed pixeldata in an electronic device according to various embodiments of thepresent invention;

FIGS. 9A to 9C illustrate a process of configuring encoded data of aunit block in an electronic device according to various embodiments ofthe present invention;

FIG. 10 illustrates a process of encoding and decoding images in anelectronic device according to various embodiments of the presentinvention;

FIG. 11 is a schematic block diagram of an electronic device accordingto various embodiments of the present invention;

FIG. 12 illustrates a method of processing a color image in anelectronic device according to various embodiments of the presentinvention;

FIGS. 13A and 13B illustrate a method of analyzing pixel values in anelectronic device according to various embodiments of the presentinvention;

FIG. 14 illustrates a method of determining a pixel pattern in anelectronic device according to various embodiments of the presentinvention;

FIG. 15 illustrates a method of encoding images in an electronic deviceaccording to various embodiments of the present invention;

FIG. 16 illustrates a method of encoding images and decoding encodedimages, according to pixel patterns, in an electronic device accordingto various embodiments of the present invention;

FIG. 17 illustrates a method of decoding a encoded image in anelectronic device according to various embodiments of the presentinvention; and

FIGS. 18A to 18C illustrate images encoded according to pixel patternsin an electronic device, by comparison with each other, according tovarious embodiments of the present invention.

DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION

Hereinafter, embodiments of the present invention will be described withreference to the accompanying drawings. Although specific embodimentsare illustrated in the drawings and related detailed descriptions arediscussed, the present invention may have various modifications andseveral embodiments. However, the present invention is not limitedthereto and it should be understood that the present invention includesall changes and/or equivalents and substitutes included in the spiritand scope of various embodiments of the present invention. In connectionwith descriptions of the drawings, similar components are designated bythe same reference numeral. A detailed description of related knownconfigurations or functions incorporated herein will be omitted for thesake of clarity and conciseness.

The terms “include” or “includes” which may be used in describingvarious embodiments of the present invention refer to the existence of acorresponding disclosed function, operation or component which can beused in various embodiments of the present invention and does not limitone or more additional functions, operations, or components. In variousembodiments of the present invention, the terms such as “include” or“have” may be construed to denote a certain characteristic, number,step, operation, constituent element, component or a combinationthereof, but may not be construed to exclude the existence of or apossibility of addition of one or more other characteristics, numbers,steps, operations, constituent elements, components or combinationsthereof.

In various embodiments of the present invention, the expressions “or” or“at least one of A or/and B” include any or all of combinations of wordslisted together. For example, the expression “A or B” or “at least Aor/and B” includes A, includes B, or includes both A and B.

The expression “1”, “2”, “first”, or “second” used in variousembodiments of the present invention may modify various components ofthe various embodiments but does not limit the corresponding components.For example, the above expressions do not limit the sequence and/orimportance of the components. The expressions may be used fordistinguishing one component from other components. For example, a firstuser device and a second user device indicate different user devicesalthough both are user devices. For example, without departing from thescope of the present invention, a first structural element may bereferred to as a second structural element, and the second structuralelement also may be referred to as the first structural element.

When it is stated that a component is “coupled to” or “connected to”another component, the component may be directly coupled or connected toanother component or a new component may exist between the component andanother component. In contrast, when it is stated that a component is“directly coupled to” or “directly connected to” another component, anew component does not exist between the component and anothercomponent.

The terms used in describing various embodiments of the presentinvention are only examples for describing a specific embodiment and donot limit the various embodiments of the present invention. Singularforms are intended to include plural forms unless the context clearlyindicates otherwise.

Unless defined differently, all terms used herein, which includetechnical terminologies or scientific terminologies, have the samemeaning as that understood by a person skilled in the art to which thepresent invention pertains. Such terms as those defined in a generallyused dictionary are to be interpreted to have the same meanings as thecontextual meanings in the relevant field of art, and are not to beinterpreted to have ideal or excessively formal meanings unless clearlydefined in the present description.

An electronic device according to various embodiments of the presentinvention may include an image processing function able to encode colordifference data in accordance with pattern of pixels when processingimage configured with pixel data, first color difference data and secondcolor difference data.

For example, the electronic device may be one or a combination of asmart phone, a tablet Personal Computer (PC), a mobile phone, a videophone, an e-book reader, a desktop PC, a laptop PC, a netbook computer,a Personal Digital Assistant (PDA), a camera, and a wearable device suchas a Head-Mounted-Device (HMD) including electronic glasses, electronicclothes, and electronic bracelet, an electronic necklace, an electronicappcessary, an electronic tattoo, and a smart watch.

According to some embodiments, the electronic device may be a smart homeappliance having a projection function. The smart home applianceincludes at least one of a TeleVision (TV), a Digital Video Disk (DVD)player, an audio player, an air conditioner, a cleaner, an oven, amicrowave oven, a washing machine, an air cleaner, a set-top box, a TVbox such as Samsung HomeSync™, Apple TV™, or Google TV™, game consoles,an electronic dictionary, an electronic key, a camcorder, and anelectronic frame.

According to some embodiments, the electronic device may include atleast one of various types of medical devices such as Magnetic ResonanceAngiography (MRA), Magnetic Resonance Imaging (MRI), Computed Tomography(CT), a scanner, an ultrasonic device and the like), a navigationdevice, a Global Positioning System (GPS) receiver, an Event DataRecorder (EDR), a Flight Data Recorder (FDR), a vehicle infotainmentdevice, electronic equipment for a ship such as a navigation device or agyro compass, avionics, a security device, a head unit for a vehicle, anindustrial or home robot, an Automatic Teller Machine (ATM) of financialinstitutions, and a Point Of Sale (POS) device of shops.

According to some embodiments, the electronic device may include atleast one of furniture or a part of a building/structure, an electronicboard, an electronic signature receiving device, a projector, andvarious types of measuring devices such as a water meter, an electricitymeter, a gas meter, and a radio wave meter including a projectionfunction. The electronic device according to various embodiments of thepresent invention may be one or a combination of the above-describedvarious devices, and may be a flexible device. It is apparent to thoseskilled in the art that the electronic device according to variousembodiments of the present invention is not limited to theabove-described devices.

Hereinafter, the term “user” used in various embodiments may refer to aperson who uses the electronic device or a device such as an artificialintelligence device which uses an electronic device.

FIG. 1 illustrates a network environment 100 including an electronicdevice 101 according to various embodiments of the present invention.Referring to FIG. 1, the electronic device 101 includes a bus 110, aprocessor 120, a memory 130, an input/output interface 140, a display150, a communication interface 160, and a image-processing module 170.

The bus 110 is a circuit connecting and transmitting communicationbetween the above-described components.

The processor 120 receives commands from other components of theelectronic device 101 such as the memory 130, the input/output interface140, the display 150, the communication interface 160, or the projectingmanagement module 170 through the bus 110, analyzes the receivedcommands, and executes calculation or data processing according to theanalyzed commands.

The memory 130 stores commands or data received from the processor 120or other components of the electronic device 101, or generated by theprocessor 120 or other components. The memory 130 includes a kernel 131,middleware 132, an Application Programming Interface (API) 133, and anapplication 134. Each of the aforementioned programming modules may beimplemented by software, firmware, hardware, or a combination of two ormore thereof.

The kernel 131 controls or manages system resources such as the bus 110,the processor 120, or the memory 130 used for executing an operation orfunction implemented by the other programming modules. The kernel 131provides an interface for accessing individual components of theelectronic device 101 from the middleware 132, the API 133, or theapplication 134 to control or manage the components.

The middleware 132 performs a relay function of allowing the API 133 orthe application 134 to communicate with the kernel 131 to exchange data.In operation requests received from the application 134, the middleware132 performs a control for the operation requests, such as scheduling orload balancing, by assigning a priority by which system resources of theelectronic device 101 can be used, to the application 134.

The API 133 is an interface by which the application 134 can control afunction provided by the kernel 131 or the middleware 132 and includes,for example, at least one interface or function for a file control,window control, image processing, or character control.

According to various embodiments, the application 134 includes a ShortMessage Service (SMS)/Multimedia Messaging Service (MMS), email,calendar, alarm application, health care such as for measuring quantityof exercise or blood sugar, or environment information application suchas for providing information on barometric pressure, humidity ortemperature. Additionally or alternatively, the application 134 may berelated to an information exchange between the electronic device 101 andan external electronic device, such as a notification relay applicationfor transferring particular information to the external electronicdevice or a device management application for managing the externalelectronic device.

For example, the notification relay application includes a function oftransmitting notification information generated by another applicationof the electronic device 101 to the external electronic device 104.Additionally or alternatively, the notification relay applicationreceives notification information from, for example, the externalelectronic device 104 and provides the received notification informationto the user. The device management application manages at least a partof the functions of the external electronic device 104 communicatingwith the electronic device 101, an application executed in the externalelectronic device 104, and a service such as call or message serviceprovided by the external electronic device 104.

According to various embodiments, the application 134 is designatedaccording to an attribute or type of the external electronic device 104.For example, when the external electronic device 104 is an MP3 player,the application 134 is related to music reproduction. Similarly, whenthe external electronic device 104 is a mobile medical device, theapplication 134 is related to health care. According to an embodiment,the application 134 includes at least one of an application designatedto the electronic device 101 and an application received from anexternal electronic device, such as the server 106 or electronic device104.

The input/output interface 140 transmits a command or data input fromthe user through an input/output device such as a sensor, keyboard, ortouch screen to the processor 120, the memory 130, the communicationinterface 160, or the display control module 170 through the bus 110.For example, the input/output interface 140 provides data on a user'stouch input through a touch screen to the processor 120, and outputs acommand or data received, through the bus 110, from the processor 120,the memory 130, the communication interface 160, or the projectingmanagement module 170 through the input/output device such as a speakeror a display.

The display 150 displays various pieces of information to the user.

The communication interface 160 connects communication between theelectronic device 101 and the external device. For example, thecommunication interface 160 accesses a network 162 through wireless orwired communication to communicate with the external device. Thewireless communication includes at least one of, for example, WiFi,BlueTooth® (BT), Near Field Communication (NFC), a Global PositioningSystem (GPS), and cellular communication such as Long Term Evolution(LTE), LTE-Advanced (LTE-A), Code Division Multiple Access (CDMA),Wideband CDMA (WCDMA), Universal Mobile Telecommunications Service(UMTS), WiBro or Global System for Mobile Communications (GSM). Thewired communication includes at least one of a Universal Serial Bus(USB), a High Definition Multimedia Interface (HDMI), RecommendedStandard 232 (RS-232), and a Plain Old Telephone Service (POTS).

According to an embodiment, the network 162 is a telecommunicationnetwork including at least one of a computer network, Internet, Internetof Things, and a telephone network. A protocol such as transport layer,data link layer, or physical layer protocol for communication betweenthe electronic device 101 and the external device may be supported by atleast one of the application 134, the API 133, the middleware 132, thekernel 131, and the communication interface 160.

According to an embodiment, at least one of functions performed by theelectronic device 101 can be performed by the external device. Forexample, the server 106 includes an image processing server modulecorresponding to the image-processing module 170, and the server 106 canprocess at least one of functions relating to a user using the imageprocessing server module and transmit result to the electronic device101.

FIG. 2 illustrates a schematic block diagram of an electronic device 200(e.g., electronic device 101 shown in FIG. 1) for processing imagesaccording various embodiments of the present invention. The electronicdevice 200 includes a controller 210, a storage 220, a display 230, aninput unit 240 and a communication unit 250. Referring to FIG. 1, thecontroller 210 may be a processor (e.g., Application Processor (AP), ahardware module, a software module, and firmware, which are controlledby the processor, or a combination thereof. According to an embodiment,the controller 210 includes control logic corresponding to at least partof the functions of the image-processing module 170, executed by theprocessor 120. The controller 210 includes a pixel analysis module 213,a pattern-determining module 215, and a coding module 217 that performsencoding, in order to process the color image from the image-processingmodule 170.

The controller 210 determines a pixel pattern of an image by analyzingpixel data of the image, and encodes the image according to thedetermined pixel pattern. An example of the image is a video shown onthe display 230. The image includes elements such as objects includingone or more persons, place or things.

The pixel data includes at least one of luminance data, first colordifference data and second color difference data, which may be YCbCrrepresenting a color space. In that case, the luminance data may be Yrepresenting a luminance signal. For example, the first color differencedata may be Cb representing the color difference signal of blue, and thesecond color difference data may be Cr representing the color differencesignal of red.

According to an embodiment, the controller 210 determines a pixelpattern of an image by analyzing one of luminance data, first colordifference data or second color difference data, as a unit of a block(unit block), and encodes the first color difference data Cb or secondcolor difference data Cr, according to the determined pixel pattern. Forexample, the data used to analyze a pixel pattern as a unit block may beluminance data, and the data encoded according to the determined pixelpattern may be Cb and Cr.

According to an embodiment, in operation of the controller 210, thepixel analysis module 213 analyzes luminance data in the size of a unitblock and creates pixel analysis data. The pattern-determining module215 determines a pixel pattern corresponding to the pixel analysis dataand outputs flag data of the determined pixel pattern. The encodingmodule 217 compresses and encodes Cb and Cr data according to thedetermined pattern, and creates encoded data including the Cb and Crdata compressed and encoded, the flag data, and the luminance data.

According to an embodiment, the controller 210 may further include acolor space conversion module which can convert an image format of theimage before the process of the pixel analysis module 213. The colorspace conversion module receives RGB image as an input image andconverts the input image to a YCbCr image.

According to an embodiment, the storage 220 stores images encoded by thecontroller 210. The storage 220 stores flag data in a Table. Forexample, the flag data may be used to determine a pixel pattern in thecontroller 210 according to the analyzed pixel data. The encoded dataincluding flag data corresponding to the determined pixel pattern may bestored in the storage 220.

The flag data may be information with results by analyzing a pixelpattern and may be used to analyze the pixel pattern.

According to an embodiment, the controller 210 controls the display 230to display still or moving images. The controller 210 receives inputimages through the input unit 240, such as RGB data or YCbCr data. Theinput unit 240 includes a color space converter for converting RGB datato YCbCr 444 data.

FIGS. 3A to 3D illustrate configurations of pixels for an image in anelectronic device according to various embodiments of the presentinvention.

Referring to FIGS. 3A to 3D, images are formed with luminance pixels andchrominance pixels.

According to an embodiment, an image may be a component image and may beformed with luminance Y and color difference signals such as Cb and Cr.The color resolution of an image may be represented with 4:n:m, in which‘4’ denotes a sampling rate of a standard frequency 13.5 MHz, forconverting analog TV signals into digital signals, and ‘n’ and ‘m’denote the rates of the corresponding color difference signals, Cb andCr, respectively. For YCbCr 4 nm, ‘4’ denotes the number of Y pixelssorted by a unit block. YCbCr 4 nm may be YCbCr 444, YCbCr 422 or YCbCr420. When YCrCb 4 nm is restored, the decoder restores color differencedata Cb and Cr to RGB data by using Y data. According to variousembodiments, YCbCr 4 nm may be a unit block. As shown in FIGS. 3A to 3D,‘H’ denotes horizontal chrominance resolution, ‘V’ denotes verticalchrominance resolution and ‘T’ denotes total chrominance resolution.

As shown in FIG. 3A, 4:4:4 indicates that three components channels areidentically sampled at 13.5 MHz. The color resolution of 4:4:4 indicatesthat the pixels of luminance Y and color difference signals Cb and Crhave the same rate.

As shown in FIG. 3B, 4:2:2 indicates that when the Y signal is sampledevery line at 13.5 MHz, the color difference signals are sampled everytwo lines as horizontal lines at 6.75 MHz. The color resolution 4:2:2indicates that the respective rates of pixels of color differencesignals Cb and Cr are a half of those of luminance Y pixel.

As shown in FIG. 3C, 4:4:0 indicates that when the Y signal is sampledevery line at 13.5 MHz, the color difference signals are sampled everytwo lines as vertical lines at 6.75 MHz. The color resolution 4:4:0indicates that the respective rates of pixels of color differencesignals Cb and Cr are a half of those of luminance Y pixel.

As shown in FIG. 3D, 4:2:0 indicates that when the Y signal is sampledevery line at 13.5 MHz, the color difference signals are sampled everytwo lines as horizontal lines at 6.75 MHz and every two lines asvertical lines at 6.75 MHz. The color resolution of 4:2:0 indicates thatthe respective rates of pixels of color difference signals Cb and Cr area quarter of that of luminance Y pixel.

An image of a color resolution shown in FIG. 3B and/or FIG. 3 may beless than that of 4:4:4 shown in FIG. 3A. The electronic deviceaccording to various embodiments displays images in various forms. Sincethe images shown in FIGS. 3B to 3D are formed in such a manner that therates of pixels of color difference signals are less than those of theluminance Y, the images may be displayed in a relatively low qualityrepresentation according to pixel patterns. For example, user interfaceimages and graphic images may have an abrupt change at the boundariesaccording to objects forming the image. In that case, when the pixels ofcolor difference signals are reduced with the pixel pattern shown inFIG. 3B or 3C, the boundaries of the image may not be clearly displayed.

The electronic device according to various embodiments of the presentinvention encodes color difference signals, shown in FIG. 3B or 3C, byusing a method that determines a pixel pattern of a unit block byanalyzing pixels in a size of a unit block, and encodes pixels of colordifference signals according to the determined pixel pattern. Thecontroller 210 encodes pixels of a color difference signal according toa pixel pattern of a unit block, thereby reducing blue at the boundariesof an image displayed on the display 230 and thus displaying the imagewith sharp boundaries.

FIG. 4 illustrates examples of a pattern of pixels in a unit block in anelectronic device according to various embodiments of the presentinvention.

Referring to FIG. 4, pixels of a unit block (e.g., 4 pixels) may havedifferent values, and may have unique patterns according to values ofthe pixels. For example, when an encoding process is performed toconvert a unit block of 4 pixels into 2 pixels (e.g., an image ofresolution 4:4:4 is encoded to an image of resolution 4:2:2), thecontroller 210 compares values of pixels of a unit block with a presetthreshold, respectively, analyzes the comparison results, and determinespatterns of pixels in unit blocks.

After analyzing pixels of a unit block, the controller 210 determines apattern of pixels that have values greater than a threshold and apattern of pixels that have values less than the threshold, within theunit block. The values of pixels within the unit block may be properlyencoded according to the determined pattern. The unit block foranalyzing patterns may use luminance pixels or color difference pixels.In an electronic device according to various embodiments of the presentinvention, luminance pixels are used to determine patterns. Thecontroller 210 determines pixel patterns of a unit block using luminancepixels and encodes color difference pixels of a unit block correspondingto the determined pattern.

Reference numerals 411 to 415 of FIG. 4 are examples of a pattern aspixels with similar values are located in the top and bottom in a unitblock. In that case, the controller 210 creates flag data pattern 0. Thecontroller 210 creates first encoding data (e.g., CB1, CR1) bycalculating (a+b)/2 from color difference pixels of a corresponding unitblock and second encoding data (e.g., CB2, CR2) by calculating (c+d)/2from color difference pixels of a corresponding unit block.

Reference numerals 421 and 423 of FIG. 4 are examples of a pattern aspixels with similar values are located in the left-hand side andright-hand side of a unit block. In that case, the controller 210creates flag data pattern 1. The controller 210 creates first encodingdata (e.g., CB1, CR1) by calculating (a+c)/2 from color differencepixels of a corresponding unit block and second encoding data (e.g.,CB2, CR2) by calculating (b+d)/2 from color difference pixels of acorresponding unit block.

Reference numerals 431 and 433 of FIG. 4 are examples of a pattern aspixels with similar values are diagonally located in a unit block. Inthat case, the controller 210 creates flag data pattern 2. Thecontroller 210 creates first encoding data (e.g., CB1, CR1) bycalculating (a+d)/2 from color difference pixels of a corresponding unitblock and second encoding data (e.g., CB2, CR2) by calculating (b+c)/2from color difference pixels of a corresponding unit block.

Reference numerals 441 to 447 of FIG. 4 are examples of a pattern asthree of the four pixels with a value and the other pixel with anothervalue are located in a unit block. As shown at reference numeral 441,when one of the four pixels, a, has a value, and the other three, b, c,and d, have another value, the controller 210 creates flag data pattern3. The controller 210 creates first encoding data (e.g., CB1, CR1) bythe value of a pixel from color difference pixels of a correspondingunit block and second encoding data (e.g., CB2, CR2) by calculating(b+c+d)/3 from color difference pixels of a corresponding unit block.

As shown at reference numeral 443, when one of the four pixels, b, has avalue, and the other three, a, c, and d, have another value, thecontroller 210 creates flag data pattern 4. The controller 210 createsfirst encoding data (e.g., CB1, CR1) by the value of pixel b from colordifference pixels of a corresponding unit block and second encoding data(e.g., CB2, CR2) by calculating (a+c+d)/3 from color difference pixelsof a corresponding unit block. As shown at reference numeral 447, whenone of the four pixels, c, has a value, and the other three, a, b, andd, have another value, the controller 210 creates flag data pattern 6.

The controller 210 creates first encoding data (e.g., CB1, CR1) by thevalue of pixel c from color difference pixels of a corresponding unitblock and second encoding data (e.g., CB2, CR2) by calculating (a+b+d)/3from color difference pixels of a corresponding unit block. As shown atreference numeral 445, when one of the four pixels, d, has a value, andthe other three, a, b, and c, have another value, the controller 210creates flag data pattern 5. The controller 210 creates first encodingdata (e.g., CB1, CR1) by the value of pixel d from color differencepixels of a corresponding unit block and second encoding data (e.g.,CB2, CR2) by calculating (a+b+c)/3 from color difference pixels of acorresponding unit block.

According to another embodiment, when the pixel values of the unit blockhave the patterns indicated by reference numerals 441 to 447, thecontroller 210 creates first encoding data (e.g., CB1 and CR1) bycalculating the average of three pixels with a value and sets the otherpixel's value to second encoding data (e.g., CB2, CR2).

FIG. 5 is a block diagram of an image-processing module for analyzingvalues of pixels in a unit block, determining the pixel pattern based onthe pixel analyses, and encoding color difference data according to thedetermined pixel pattern in an electronic device according to variousembodiments of the present invention.

Referring to FIG. 5, the input may be an RGB image or a YCbCr image.When an RGB image is input, a color space conversion module 211 convertsthe RGB image into a YCbCr image. To this end, the color spaceconversion module 211 performs color space conversion based on thefollowing Equation 1).Y=0.29900*R+0.58700*G+0.11400*BCb=0.16874*R+0.33126*G+0.50000*BCr=0.50000*R+0.41869*G+0.08131*B  (1)

The color space conversion module 211 performs color conversion from theRGB image into a YCbCr image of 4:4:4 resolution, as shown in FIG. 6.

FIG. 6 illustrates a configuration of pixels in a unit block of a YCbCrimage by a color space conversion module 211 in an electronic deviceaccording to various embodiments of the present invention. A YCbCr imageof 4:4:4 resolution has a mapping structure with Y, Cb and Cr pixels ina unit block (e.g., 4 pixels). The color space conversion module 211analyzes values of Y, Cb and Cr pixels based on a unit block, determinesa pixel pattern, and encodes pixels according to the pixel pattern.During the process, since the Y most affects the recovery of the image,it is preferable that the pixel size remains unchanged in an encodingprocess. In addition, pixels of a unit block for analyzing pixel valuesmay use the Y pixel.

Referring back to FIG. 5, the pixel analysis module 213 analyzes pixelvalues of a unit block by using YCbCr images output from or input to thecolor space conversion module 211.

FIGS. 7A to 7C illustrate a process of analyzing pixel values of a unitblock in an electronic device according to various embodiments of thepresent invention.

FIG. 7A illustrates an arrangement of pixels in a unit block, and may bea configuration of a unit block of luminance pixels. FIG. 7B illustratesa method of operating pixels of a unit block shown in FIG. 7A by thepixel analysis module 213 illustrated in FIG. 5.

For pixels a and b indicated by reference numeral 721 in FIG. 7B, thepixel analysis module 213 calculates a difference between values ofpixels a and b, compares the absolute value of the difference with athreshold, and outputs the comparison result as ‘0’ or ‘1.’ For pixels cand d indicated by reference numeral 723 in FIG. 7B, the pixel analysismodule 213 calculates a difference between values of pixels c and d,compares the absolute value of the difference with a threshold, andoutputs the comparison result as ‘0’ or ‘1.’ For pixels a and cindicated by reference numeral 725 in FIG. 7B, the pixel analysis module213 calculates a difference between values of pixels a and c, comparesthe absolute value of the difference with a threshold, and outputs thecomparison result as ‘0’ or ‘1.’ For pixels b and d indicated byreference numeral 727, the pixel analysis module 213 calculates adifference between values of pixels b and d, compares the absolute valueof the difference with a threshold, and outputs the comparison result as‘0’ or ‘1.’ For pixels a and d indicated by reference numeral 731, thepixel analysis module 213 calculates a difference between values ofpixels a and d, compares the absolute value of the difference with athreshold, and outputs the comparison result as ‘0’ or ‘1.’ For pixels band c indicated by reference numeral 733, the pixel analysis module 213calculates a difference between values of pixels b and c, compares theabsolute value of the difference with a threshold, and outputs thecomparison result as ‘0’ or ‘1.’

The pixel analysis module 213 includes six absolute value calculatorsand the corresponding comparators. Each of the absolute valuecalculators may use same threshold, and according to another embodiment,the thresholds of the each of the absolute value calculators may bedifferent from each other. The absolute value calculators and thecorresponding comparators analyze pixel data of the respective pixelsbased on the following Equation (2) and output the pixel data as shownin FIG. 7C.Abs(Ya−Yb)>threshold valueAbs(Yc−Yd)>threshold valueAbs(Ya−Yc)>threshold valueAbs(Yb−Yd)>threshold valueAbs(Ya−Yd)>threshold valueAbs(Yb−Yc)>threshold value  (2)

The analyzed pixel data calculated by Equation (2) has a data structureof 6 bits shown in FIG. 7.

FIG. 8 illustrates examples of pattern categorization corresponding toanalyzed pixel data of 6 bits output from the pixel analysis module 213.As shown in FIG. 8, although values of analyzed pixel data differ fromeach other, their patterns are identical to each other. For example,pattern 0 of the patterns shown in FIG. 4 is created when analyzed pixeldata are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and 15.Pattern 1 is created when analyzed pixel data are 16, 17, 18, 19, 32,33, 34, 35, 48, 49, 50, and 51. Pattern 2 is created when analyzed pixeldata are 20, 24, 28, 36, 40, 44, 52, 56, and 60. In addition, when pixeldata of a unit block are 21, 23, 26, 27, 29, 30, 31, 38, 39, 41, 43, 45,46, 47, 53, 54, 55, 58, 59, 51, 62, and 63, the pixel data is classifiedas the other patterns except of Patterns 0, 1, and 2 shown in FIG. 4.

Referring back to FIG. 5, the pattern-determining module 215 determinesa pixel pattern of a unit block by using analyzed pixel data output fromthe pixel analysis module 213. When values of analyzed pixel data differfrom each other but their pixel pattern has the same structure, thepixel data is determined as having the same flag data because when thecolor difference data is encoded, the encoded data can be stored alongwith the pattern information.

For example, when the analyzed pixel data are 0, 1, 2, 3, 4, 5, 6, 7, 8,9, 10, 11, 12, 13, 14, and 15, the data can be set as the flag data ofthe same value. To this end, the storage 220 includes a flag table wherevalues of analyzed pixel data are mapped to pixel patterns as shown inFIG. 8. When the analyzed pixel data is entered, the pattern-determiningmodule 215 determines flag data of a pixel pattern corresponding to theanalyzed pixel data. The flag data may be determined to have a size of 4bits. In that case, the number of pixel patterns of a unit block may be16. Although the embodiment is described based on the flag data of 4bits, it should be understood that the size of flag data may increasewhen the pixel pattern is subdivided.

The encoding module 217 encodes color difference data according to thedetermined pixel pattern, and creates encoded data including the encodedcolor difference data, luminance data and flag data. The encoding module217 includes a color difference encoding unit for encoding colordifference data CB and CR of a unit block corresponding to the pixelpatterns, a flag inserting unit for inserting flag data to the encodedcolor difference data, and a combination unit for combining the encodedcolor difference data and the luminance data of a unit block.

The encoding module 217 encodes color difference data according to thedetermined pixel pattern. The process of encoding color difference datamay be performed based on a unit block. For example, if a unit block isformed with four pixels, the encoding module 217 encodes colordifference pixel of four pixels, Cba−Cbd and Cra−Crd, to colordifference pixel of two pixels, CB1−CB2 and CR1−CR2. This encodingscheme takes the averages of pixel values of the same patter and thencreates encoded color difference data. For example, when pixels havepattern 0, the flag data is “0000.”

The encoding module 217 calculates the average of color differencepixels Cba and Cbb and the average of color difference pixels, Cra andCrb, and creates the encoded color difference data CB1 and CR1,respectively. The encoding module 217 also calculates the average ofcolor difference pixels Cbc and Cbd and the average of color differencepixels, Crc and Crd, and creates the encoded color difference data CB2and CR2, respectively. Flag data is then inserted into the encoded colordifference data CB1−CB2 and CR1−CR2. In that case, the color differencedata may be configured as shown in the following Table 1.

TABLE 1 b7 b6 b5 b4 b3 b2 b1 b0 B1 (a7 + (a6 + (a5 + (a4 + (a3 + (a2 +(a1 + Flag 3 b7)/2 b6)/2 b5)/2 b4)/2 b3)/2 b2)/2 b1)/2 B2 (c7 + (c6 +(c5 + (c4 + (c3 + (c2 + (c1 + Flag 2 d7)/2 d6)/2 d5)/2 d4)/2 d3)/2 d2)/2d1)/2 R1 (a7 + (a6 + (a5 + (a4 + (a3 + (a2 + (a1 + Flag 1 b7)/2 b6)/2b5)/2 b4)/2 b3)/2 b2)/2 b1)/2 R2 (c7 + (c6 + (c5 + (c4 + (c3 + (c2 +(c1 + Flag 0 d7)/2 d6)/2 d5)/2 d4)/2 d3)/2 d2)/2 d1)/2

FIGS. 9A to 9C illustrate a process of configuring encoded data of aunit block in an electronic device according to various embodiments ofthe present invention. Referring to FIG. 9A, the encoding module 217creates encoded data by combining luminance data of a unit block andencoded color difference data CB and CR. FIGS. 9A to 9C illustrateconfigurations of encoded data of a unit block. The luminance dataremains with pixel data of a unit block of 4 pixels, the encoded colordifference data CB is converted to encoded color difference data of twopixels, CB1 and CB2, and encoded color difference data CR includesencoded color difference data of two pixels, CR1 and CR2. Flag data aspixel pattern information is inserted into the Least Significant Bit(LSB) of the encoded color difference data CB1−CB2 and CR1−CR2.

As shown in FIG. 9A, the controller 210 then stores an encoded image inthe storage 220 illustrated in FIG. 2. The storage efficiency of thestorage 220 may be enhanced by encoding the color difference data. Thecontroller 210 transmits the images encoded as shown in FIGS. 9A to 9Cto an external device through the communication unit 250 or anothermodule. For example, the controller 210 includes a graphic processorthat transmits the encoded image to the display 230. In that case, thetransmission rate may be enhanced by encoding the image.

As shown in FIG. 9A, the encoded image may be created as colordifference data are encoded, as a unit block, according to the pixelpattern. When the image includes outlines or boundaries of objects, thepixel pattern may be detected in various forms according to objects. Thecontroller 210 determines a pixel pattern corresponding to the outlinesor boundaries of objects in the image, and encodes color difference dataaccording to the determined pixel pattern. When the controller 210decodes an image formed with the structure shown in FIGS. 9A to 9C, thecontroller 210 verifies a pixel pattern according to flag data anddecodes pixels according to the verified pixel pattern.

For example, when pattern flag is “0000,” the controller 210 restoresvalues of pixels a and b of a unit block to CB1 and CR1, and values ofpixels c and d of a unit block to CB2 and CR2. When pattern flag is“0001,” the controller 210 restores values of pixels a and c of a unitblock to CB1 and CR1, and values of pixels b and d of a unit block toCB2 and CR2. The controller 210 decodes the color difference data of aunit block to data of 4 pixels by using the encoded color differencedata that correspond to the pixel patterns respectively.

When the loss of the quality of image is imperceptible (i.e., visuallylossless), part of the luminance data, such as the LSB, is also used tostore additional information. Unlike the configuration shown FIG. 9A, asshown in FIGS. 9B and 9C, additional information may be stored in partof color difference data and luminance data.

Referring to FIG. 9B, flag data may be stored in the LSB location of thecolor difference data and luminance data. The storage order of bits doesnot need to be the order shown in FIG. 9B. That is, the encoder foranalyzing a pixel pattern and ad the decoder for decoding the patternmay store data in a storage order of bits that are preset as a rule.

FIG. 9C illustrates a structure of encoded data that is identical tothat of FIG. 9B except that the order of bits differs from that of FIG.9B. The flags between FIG. 9C and FIG. 9B are identical to each other inthat they replace LSB values of color difference data, but are differentfrom each other in terms of their storage orders. Flags including pixelpattern information may be placed before every byte, as shown in FIG.9C, or alternatively may all be placed before the entire bit sequence.This arrangement simplifies the design of an encoder or decoder.

FIG. 10 illustrates a process of encoding and decoding images in anelectronic device according to various embodiments of the presentinvention.

Referring to FIG. 10, the controller 210 includes the coder 217 forencoding an image or color images, and a decoder 293 for decoding theencoded images. The embodiment of FIG. 10 may be an image-processingmodule 170 shown in FIG. 1. The image-processing module 170 may beincluded in the controller 210 or may be configured as a separatecomponent. The color image encoded or decoded may be a YCbCr image.

When the color space conversion module 211 receives an RGB image, thecolor space conversion module 211 coverts the RGB image to aYCbCr imagewith 4:4:4 resolution, such as by using Equation (1) or a conversionscheme set by the corresponding rule. The pixel analysis module 213receives the 4:4:4 YCbCr image from the color space conversion module211 or a 4:4:4 YCbCr image directly from outside the space conversionmodule 211.

The pixel analysis module 213 analyzes luminance pixels of a unit blockfrom the 4:4:4 YCbCr image and outputs the analyzed pixel data. Thepixel analysis module 213 obtains a difference of pixels ab, cd, ac, bd,ad, and be (4C2=6) from luminance pixels of 4 pixels (a−d), compares theabsolute values of the differences with a threshold, and outputs thecomparison results as analyzed pixel data. The analyzed pixel data maybe data of 6 bits.

The pattern-determining module 215 analyzes the analyzed pixel data anddetermines a pixel pattern. For example, the storage 220 includes a flagtable for pixel patterns corresponding to the analyzed pixel data. Whenthe storage 220 receives the analyzed pixel data, the storage 220determines flag data of the corresponding pixel pattern from the flagtable.

The encoding module 217 creates encoded color difference data CB1−CB2and CR1−CR2 of color difference data Cb and Cr according to thedetermined pixel pattern. The encoded color difference data CB1−CB2 andCR1−CR2 is used to calculate an average of pixels that have similarpixel values according to pixel patterns and the average may bedetermined as the encoded color difference data. The flag datadetermined by the pattern-determining module 215 is inserted to a lowerbit of the encoded color difference data. The encoding module 217 thencombines the encoded color difference data (including flag data) andcorresponding luminance data of a unit block, and creates the lastencoded data as shown in FIGS. 9A to 9C. The encoding module 217 outputsthe last encoded data to other modules or external devices through thecommunication unit 250. The encoding module 217 may also store the lastencoded data in the storage 220.

The images encoded as illustrated in FIGS. 9A to 9C are displayed asfollows. The controller 210 or the display 230 with a decoder decodesencoded images. In the following description, for the sake ofconvenience, the decoding process is explained based on the controller210. The controller 210 accesses encoded images in the storage 220 orreceives encoded images from other modules or external devices. When thepattern verifying module 291 receives the encoded image, the patternverifying module 291 analyzes flag data from the encoded image shown inFIGS. 9A to 9C and verifies a pixel pattern.

The decoding module 293 decodes corresponding pixels according to theverified pixel pattern. The color difference data of the encoded imagemay be created as data of 4 pixels is encoded to 2 pixels. The decodingmodule 293 restores the encoded color difference data of 2 pixels tocolor difference data of 4 pixels. When the decoding module 293 decodescolor difference data Cb and Cr, the decoding module 293 decodes 4 pixelvalues according to pixel patterns. For example, when an encoded imageis pattern 0, the decoding module 293 restores Cba and Cbb pixels toencoded CB1 data, Cbc and Cbd pixels to encoded CB2 data, Cra and Crbpixels to encoded CR1 data, and Crc and Crd pixels to encoded CR2 data.When an encoded image is pattern 1, the decoding module 293 restores Cbaand Cbc pixels to encoded CB1 data, Cbb and Cbd pixels to encoded CB2data, Cra and Crc pixels to encoded CR1 data, and Crb and Crd pixels toencoded CR2 data.

The decoded YCbCr image may be displayed on the display 230. Inaddition, when the YCbCr image is converted to an RGB image, the colorspace conversion module 295 converts the YCbCr image to an RGB imagebased on the following Equation (3).R=Y+1.402*CrG=Y−0.334*Cb−0.713*CrB=Y+1.772*Cr  (3)

As described above, the electronic device according to variousembodiments of the present invention performs analysis based onluminance data of an image and encodes color difference data, whilemaintaining the luminance data. The electronic device according tovarious embodiments analyzes luminance data of an image along with colordifference data, or performs analysis in linear combination withweights. When the loss of the quality of image by luminance data isimperceptible (i.e., visually lossless), the luminance data may be alsoincluded in objects to be encoded. When image data is encoded bycombining the luminance data and color difference data or by using colordifference data, patterns that are from among the combinations shown inFIG. 8 but do not correspond to patterns shown in FIG. 4 may be encoded.

FIG. 11 is a block diagram of an electronic device according to variousembodiments of the present invention.

The electronic device 1101 configures all or a part of the electronicdevice 101 illustrated in FIG. 1. Referring to FIG. 11, the electronicdevice 1101 includes one or more Application Processors (APs) 1110, acommunication module 1120, a Subscriber Identification Module (SIM) card1124, a memory 1130, a sensor module 1140, an input device 1150, adisplay module 1160, an interface 1170, an audio module 1180, a cameramodule 1191, a power-managing module 1195, a battery 1196, an indicator1197, and a motor 1198.

The AP 1110 operates an Operating System (OS) or an application programso as to control a plurality of hardware or software component elementsconnected to the AP 1110 and executes various data processing andcalculations including multimedia data. The AP 1110 may be implementedby a System on Chip (SoC). According to an embodiment, the processor1110 may further include a Graphic Processing Unit (GPU).

The AP 1110 includes the image-processing module 170, the elements ofFIG. 2 for encoding the color difference data according to the pixelpattern in a color image of 4:4:4 color resolution, and the elements ofFIG. 10 for restoring the encoded color difference data according to thepixel pattern.

The communication module 1120 transmits/receives data in communicationbetween different electronic devices such as the electronic device 104and the server 106 connected to the electronic device 1101 through anetwork. In FIG. 11, the communication module 1120 includes a cellularmodule 1121, a WiFi module 1123, a BlueTooth® (BT) module 1125, a GPSmodule 1127, a Near Field Communication (NFC) module 1128, and a RadioFrequency (RF) module 1129.

The cellular module 1121 provides a voice, a call, a video call, SMS, oran Internet service through a communication network. The cellular module1121 distinguishes and authenticates electronic devices within acommunication network by using a Subscriber Identification Module (SIMcard 1124). According to an embodiment, the cellular module 1121performs at least some of the functions that can be provided by the AP1110, such as the multimedia control functions.

According to an embodiment, the cellular module 1121 includes aCommunication Processor (CP). The cellular module 1121 may beimplemented by, for example, an SoC. Although the components such as thecellular module 1121, the memory 1130, and the power-managing module1195 are illustrated as components separate from the AP 1110 in FIG. 11,the AP 1110 includes at least some of the aforementioned components.According to an embodiment, the AP 1110 or the cellular module 1121loads a command or data received from at least one of a non-volatilememory and other components connected to each of the AP 1110 and thecellular module 1121 to a volatile memory and processes the loadedcommand or data. The AP 1110 or the cellular module 1121 stores datareceived from at least one of other components or generated by at leastone of other components in a non-volatile memory.

Each of the WiFi module 1123, the BT module 1125, the GPS module 1127,and the NFC module 1128 includes, for example, a processor forprocessing data transmitted/received through the corresponding module.Although the cellular module 1121, the WiFi module 1123, the BT module1125, the GPS module 1127, and the NFC module 1128 are illustrated asblocks separate from each other in FIG. 9, at least two of the cellularmodule 1121, the WiFi module 1123, the BT module 1125, the GPS module1127, and the NFC module 1128 may be included in one Integrated Chip(IC) or one IC package according to one embodiment. For example, atleast some of the processors corresponding to the cellular module 1121,the WiFi module 1123, the BT module 1125, the GPS module 1127, and theNFC module 1128 may be implemented by one SoC.

The RF module 1129 transmits/receives data such as an RF signal. The RFmodule 1129 includes, for example, a transceiver, a Power Amp Module(PAM), a frequency filter, and a Low Noise Amplifier (LNA). The RFmodule 1129 may further include a component for transmitting/receivingelectronic waves over a free air space in wireless communication, suchas a conductor or a conducting wire. Although the cellular module 1121,the WiFi module 1123, the BT module 1125, the GPS module 1127, and theNFC module 1128 share one RF module 1129 in FIG. 11, at least one of themodules may transmit/receive an RF signal through a separate RF moduleaccording to one embodiment.

The SIM card 1124 is inserted into a slot formed in a particular portionof the electronic device, and includes unique identification informationsuch as an Integrated Circuit Card IDentifier (ICCID) or subscriberinformation such as an International Mobile Subscriber Identity (IMSI).

The memory 1130 includes an internal memory 1132 or an external memory1134. The internal memory 1132 includes, for example, at least one of avolatile memory such as a Random Access Memory (RAM), a dynamic RAM(DRAM), a static RAM (SRAM), and a synchronous dynamic RAM (SDRAM), anda non-volatile Memory such as a Read Only Memory (ROM), a One-TimeProgrammable ROM (OTPROM), a Programmable ROM (PROM), an Erasable andProgrammable ROM (EPROM), an Electrically Erasable and Programmable ROM(EEPROM), a mask ROM, a flash ROM, a NAND flash memory, and a NOR flashmemory.

According to an embodiment, the internal memory 1132 may be a SolidState Drive (SSD). The external memory 1134 may further include a flashdrive such as a Compact Flash (CF), a Secure Digital (SD), a MicroSecure Digital (Micro-SD), a Mini Secure Digital (Mini-SD), an extremeDigital (xD), or a memory stick. The external memory 1134 may befunctionally connected to the electronic device 1101 through variousinterfaces. According to an embodiment, the electronic device 1101 mayfurther include a storage device such as a hard drive.

The sensor module 1140 measures a physical quantity or detects anoperation state of the electronic device 101, and converts the measuredor detected information to an electronic signal. The sensor module 1140includes a gesture sensor 1140A, a gyro sensor 1140B, an atmosphericpressure (barometric) sensor 1140C, a magnetic sensor 1140D, anacceleration sensor 1140E, a grip sensor 1140F, a proximity sensor1140G, a color sensor 1140H (for example, Red, Green, and Blue (RGB)sensor) 1140H, a biometric sensor 1140I, a temperature/humidity sensor1140J, an illumination (light) sensor 1140K, and a Ultra Violet (UV)sensor 1140M.

Additionally or alternatively, the sensor module 1140 may include anE-nose sensor, an Electromyography (EMG) sensor, an Electroencephalogram(EEG) sensor, an Electrocardiogram (ECG) sensor, an InfraRed (IR)sensor, an iris sensor, and a fingerprint sensor (not illustrated). Thesensor module 1140 may further include a control circuit for controllingone or more sensors included in the sensor module 1140.

The input device 1150 includes a touch panel 1152, a (digital) pensensor 1154, a key 1156, and an ultrasonic input device 1158. Forexample, the touch panel 1152 recognizes a touch input in at least oneof a capacitive, resistive, infrared, and acoustic wave type. The touchpanel 1152 may further include a control circuit. In the capacitivetype, the touch panel 1152 can recognize proximity as well as a directtouch. The touch panel 1152 may further include a tactile layer thatprovides a tactile reaction to the user.

The (digital) pen sensor 1154 may be implemented, for example, using amethod identical or similar to a method of receiving a touch input ofthe user, or using a separate recognition sheet. The key 1156 includes,for example, a physical button, an optical key, or a key pad. Theultrasonic input device 1158 detects an acoustic wave by a microphone1188 of the electronic device 1101 through an input means generating anultrasonic signal to identify data and performs wireless recognition.

According to an embodiment, the electronic device 1101 receives a userinput from an external device connected to the electronic device 1101 byusing the communication module 1120.

The display module 1160 includes a panel 1162, a hologram unit 1164, anda projector 1166. The panel 1162 may be, for example, a Liquid CrystalDisplay (LCD) or an Active Matrix Organic Light Emitting Diode(AM-OLED), and is implemented to be flexible, transparent, or wearable.The panel 1162 may be configured by the touch panel 1152 and one module.The hologram unit 1164 projects a stereoscopic image in the air by usinginterference of light. The projector 1166 projects light on a screen todisplay an image, wherein the screen may be located inside or outsidethe electronic device 1101. According to an embodiment, the display 1160may further include a control circuit for controlling the panel 1162,the hologram unit 1164, and the projector 1166.

The interface 1170 includes, for example, a High-Definition MultimediaInterface (HDMI) 1172, a Universal Serial Bus (USB) 1174, an opticalinterface 1176, and a D-subminiature (D-sub) 1178, and is included inthe communication interface 160 illustrated in FIG. 1. Additionally oralternatively, the interface 1190 may include a Mobile High-definitionLink (MHL) interface, a Secure Digital (SD) card/Multi-Media Card (MMC),or an Infrared Data Association (IrDA) standard interface.

The audio module 1180 bi-directionally converts a sound and anelectronic signal. At least some components of the audio module 1180 maybe included in the input/output interface 140 illustrated in FIG. 1. Theaudio module 1180 processes sound information input or output through,for example, a speaker 1182, receiver 1184, earphones 1186, or themicrophone 1188.

The camera module 1191 photographs a still image and video. According toan embodiment, the camera module 1191 includes one or more image sensorssuch as a front or back sensor, an Image Signal Processor (ISP) or aflash such as a Light-Emitting Diode (LED) or xenon lamp.

The power-managing module 1195 manages power of the electronic device1101 and includes, for example, a Power Management Integrated Circuit(PMIC), a charger Integrated Circuit (IC), or a battery gauge.

The PMIC may be mounted to, for example, an integrated circuit or an SoCsemiconductor. A charging method may be divided into wired and wirelessmethods. The charger IC charges a battery and prevents over voltage orover current from flowing from a charger. According to an embodiment,the charger IC includes a charger IC for at least one of the wiredcharging method and the wireless charging method. The wireless chargingmethod includes, for example, a magnetic resonance method, a magneticinduction method and an electromagnetic wave method, and additionalcircuits for wireless charging may be added, such as a coil loop, aresonant circuit, or a rectifier.

The battery gauge measures a remaining quantity of the battery 1196, avoltage, a current, or a temperature during charging. The battery 1196stores or generates electricity and supplies power to the electronicdevice 1101 by using the stored or generated electricity. The battery1196 includes a rechargeable battery or a solar battery.

The indicator 1197 displays particular statuses of the electronic device101 or a part of the electronic device 101, for example, a bootingstatus, a message status, and a charging status.

The motor 1198 converts an electrical signal to a mechanical vibration.Although not illustrated, the electronic device 101 may include a GPUfor supporting a module TV, such as media data according to a standardof Digital Multimedia Broadcasting (DMB), Digital Video Broadcasting(DVB), or media flow.

Each of the components of the electronic device according to variousembodiments of the present invention may be implemented by one or morecomponents and the name of the corresponding component may varydepending on a type of the electronic device. The electronic deviceaccording to various embodiments of the present invention includes allof, at least one of, or additional components to the above-describedcomponents. Some of the components of the electronic device may becombined to form a single entity, and thus may equivalently executefunctions of the corresponding components before being combined.

The electronic device according to various embodiments of the presentinvention includes a controller for analyzing pixel data of an image,determining a pixel pattern, and encoding the image according to thedetermined pixel pattern, and a display, functionally connected to thecontroller, for displaying the image.

The pixel data includes luminance data, first color difference data andsecond color difference data. The controller analyzes one or more ofluminance data, first color difference data and second color differencedata, determines a pixel pattern based on the analysis, andre-configures the luminance data, first color difference data and secondcolor difference data according to the determined pixel pattern.

The first color difference data is indicated by Cb and the second colordifference data is indicated by Cr. The controller analyzes luminancepixel values of a preset unit block, determines a pixel pattern of theunit block, and encodes the Cb and Cr according to the determined pixelpattern.

The controller includes a pixel analysis unit for analyzing luminancepixel values of a unit block and outputting the analyzed pixel data, apattern determining unit for determining a pixel pattern correspondingto the analyzed pixel data and outputting flag data of the determinedpixel pattern, and an encoding unit for compressing and encoding Cb andCr data to the determined pixel pattern and creating encoded dataincluding the flag data, luminance data, and the compressed, encoded Cband Cr data. When the image is RGB data, the controller includes a colorspace conversion unit for converting colors from RGB data to YCbCr data.

The pixel analysis unit includes a plurality of absolute valuecalculators for calculating absolute values Abs (Ya−Yb), Abs (Yc−Yd),Abs (Ya−Yc), Abs (Yb−Yd), Abs (Ya−Yd) and Abs (Yb−Yc) from Ya−Yd dataforming unit data of luminance data, and a plurality of comparators forcomparing the absolute values with a threshold and outputting analyzedpixel data.

The pattern determining unit analyzes the analyzed pixel data,determines a pixel pattern based on the analysis, and outputs flag dataaccording to the determined pixel pattern.

The encoding unit includes a CB encoding unit for calculating an averageof Cb pixels corresponding to a combination of pixels less than thethreshold according to the determined pixel pattern, and creating firstencoded data CB1 and second encoded data CB2, a Cr encoding unit forcalculating an average of Cr pixels corresponding to a combination ofpixels having values less than the threshold according to the determinedpixel pattern, and creating first encoded data CR1 and second encodeddata CR2, a flag inserting unit for inserting the flag data to CB1−CB2and CR1−CR2, and a combination unit for combining Ya−Yd, CB1, CB2, CR1and CR2 and flag data to create encoded data. The flag inserting unitinserts the flag data to the LSB of CB1, CB2, CR1 and CR2.

The controller further includes a pattern determining unit foranalyzing, when displaying an image, flag data in an encoded image andverifying a pattern, a decoding unit for restoring first colordifference data and second color difference data according to theverified pattern, and a color space conversion unit for converting, whenthe display is an RGB display, luminance data, first color differencedata and second color difference data, output from the decoding unit, toRGB data.

FIG. 12 illustrates a method of processing a color image in anelectronic device according to various embodiments of the presentinvention.

Referring to FIG. 12, when an image processing application is executed,the controller 210 detects the execution and performs an imageprocessing function in step 1211, such as processing a color image ofluminance data and color difference data. The image processing functionmay be for encoding color difference data of the color image of 4:4:4resolution in a preset size. For example, the image is a YCbCr image andthe image processing function is for encoding color difference data of 4pixels to a color difference of 2 pixels. When the image is an RGBimage, the controller 210 ascertains that the RGB image requires a colorconversion in step 1213 and coverts the RGB image to an YCbCr image byusing a scheme expressed by Equation (1) in step 1215.

The YCbCr image may be a color image of 4:4:4 resolution, whichindicates that the pixels of luminance Y and color difference signals Cband Cr have the same rate. The color resolution of 4:2:2 shown in FIG.3B and the color resolution of 4:4:0 shown in FIG. 3C indicate that therespective rates of pixels of color difference signals Cb and Cr arehalf of those of luminance Y pixel. However, since color images wherethe rates of luminance data and color difference data differ from eachother have the rates of pixels of color difference signals less than therate of the luminance pixels, the color images may be displayed in arelatively low quality according to pixel patterns.

In order to encode color difference pixels with a rate that differs fromthat of luminance pixel, a method may be used that analyzes pixels interms of a unit block, determines a pixel pattern of the unit block, andencodes pixels of color difference signals according to the determinedpixel pattern. For example, the controller 210 encodes pixels of colordifference signals according to a pixel pattern of a unit block, therebyreducing blur at the boundaries of an image displayed on the display 230and displaying sharp boundaries.

The controller 210 analyzes specific data such as luminance data Y in aYCbCr image of 4:4:4 color resolution based on a unit block, createsanalyzed pixel data, determines a pixel pattern of a unit blockcorresponding to the created, analyzed pixel data, and encodes colordifference data according to the determined pixel pattern. The pixelpattern may be detected in different forms according to locations of anobject in an image. For example, when the outline or boundary of anobject is located widthwise, lengthwise, or diagonally, the pixelpatterns in the unit block may be determined as different patterncategories. The remainder of the method of FIG. 12 will be provided inthe description of FIGS. 13A-13B and 14-17, as follows.

FIGS. 13A and 13B illustrate a method of analyzing pixel values in anelectronic device according to various embodiments of the presentinvention.

Referring to FIG. 13A, a YCbCr image of 4:4:4 resolution has a structurewhere Y, Cb and Cb pixels are mapped with a size of a unit block (e.g.,4 pixels). The values of Y, Cb or Cb pixels are analyzed in a size of aunit block to determine a pixel pattern and then pixels are encodedaccording to the pixel pattern. During the process, since the Y mostlyaffects the recovery of an image, it is preferable that the pixel sizeremains the same size in an encoding process. When color differenceinformation plays an important function according to image property orluminance information is restored to be visually lossless, part of theluminance (Y) image information may be used for the purpose of storingpattern information. In addition, pixels of a unit block to analyzepixel values may use Y pixels. The controller 210 selects luminance dataof a unit block in order to determine a pixel pattern in step 1311.

The controller 210 operates values of luminance pixels in a unit blockin step 1313. During this process, the pixel analysis module 213analyzes pixel values of a unit block by using a YCbCr imageoutput/input from/to the color space conversion module 211 shown in FIG.6. The arrangement of luminance pixels in a unit block has a structureshown in FIG. 7A. The controller 210 operates values of luminance pixelsin a unit block through the method shown in FIG. 7B.

The controller 210 calculates a difference between two pixel values in aunit block and the absolute value of the difference, by using Equation(2), in step 1313. The controller 210 compares the absolute value of thedifference with a threshold in step 1315, and outputs the comparisonresult as ‘0’ or ‘1’ in step 1317. The analyzed pixel data calculated byusing Equation (2) may be data of 6 bits with a structure shown in FIG.7C.

Referring to FIG. 13B, the controller 210 selects luminance data of aunit block in order to determine a pixel pattern in step 1331, operatespixel values of luminance data and color difference data in step 1333,compares the calculated pixel values with corresponding thresholdsrespectively in step 1335, and outputs the analyzed pixel data in step1337.

The pixel pattern may be analyzed based on the luminance pixel value asshown in FIG. 13A or by using the luminance pixel value and colordifference pixel values as shown in FIG. 13B. For example, in the methodshown in FIG. 13B, a pixel value may be determined considering luminanceand color difference or based on a linear combination of luminance andcolor difference. The method shown in FIG. 13B may also be applied tothe operation 213 shown in FIG. 5. Referring back to FIG. 12, thecontroller 210 analyzes pixel values by using the methods shown in FIGS.13A and 13B in step 1217, and determines a pixel pattern correspondingto the analyzed pixel data in step 1219.

FIG. 14 illustrates a method of determining a pixel pattern in anelectronic device according to various embodiments of the presentinvention.

Referring to FIG. 14, although values of analyzed pixel data of 6 bitsdiffer from each other, the pattern categorization has the identicalpattern for the analyzed pixel data. For example, as shown in FIG. 4,pixel pattern 0 may be created when analyzed pixel data are 0, 1, 2, 3,4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and 15, and pixel pattern 1 may becreated when analyzed pixel data are 16, 17, 18, 19, 32, 33, 34, 35, 48,49, 50, and 51. When analyzed pixel data have different values but anidentical pixel pattern structure, the analyzed pixel data may bedetermined as identical flag data. To this end, the storage 220 includesa flag table for mapping between analyzed pixel data and pixel patterns.

When analyzed pixel data is created, the controller 210 determines apixel pattern corresponding to the analyzed pixel data in step 1411, andgenerates flag data corresponding to the determined pixel pattern instep 1413. The flag data may be determined to be 4 bits in size. In thatcase, the number of pixel patterns of a unit block may be 16. Althoughthe embodiment describes pixel patterns generated based on 4 bits offlag data, it should be understood that the size of flag data mayincrease when the pixel pattern is subdivided.

Referring back to FIG. 12, after generating the flag data, thecontroller 210 encodes color difference data according to the determinedpixel pattern and creates encoded data including the encoded colordifference data, luminance data and flag data in step 1221.

FIG. 15 illustrates a method of encoding images in an electronic deviceaccording to various embodiments of the present invention.

Referring to FIG. 15, the controller 210 encodes color difference dataCb and Cr according to the determined pixel pattern in steps 1511 and1513. Specifically, the color difference data may be encoded, accordingto a pixel pattern, based on a unit block. For a unit block of 4 pixels,the controller 210 encodes color difference pixels of 4 pixels, Cba−Cbd,to color difference pixels of 2 pixels, CB1−CB2, according to a pixelpattern in step 1511. The controller 210 encodes color difference pixelsof 4 pixels, Cra−Crd, to color difference pixels of 2 pixels, CR1−CR2,according to a pixel pattern in step 1513. The encoding method isperformed in such a manner as to obtain an average of pixel values ofthe identical pattern and to create encoded color difference data fromthe average.

For example, for pattern 0, the controller 210 calculates an average ofcolor difference pixels Cba and Cbb and the average of color differencepixels, Cra and Crb, and creates the encoded color difference data CB1and CR1, respectively. The controller 210 may also calculate the averageof color difference pixels Cbc and Cbd and the average of colordifference pixels, Crc and Crd, and create the encoded color differencedata CB2 and CR2, respectively. The controller 210 inserts flag datainto the encoded color difference data CB1−CB2 and CR1−CR2 in step 1515,in which case the color difference data may be configured as shown inTable 1.

The controller 210 creates encoded data by combining luminance data of aunit block and encoded color difference data CB and CR in step 1517.

FIGS. 9A to 9C illustrate configurations of encoded data of a unitblock. Referring back to FIG. 12, after creating the encoded data ofstructures shown in FIGS. 9A to 9C, the controller 210 stores theencoded image in the storage 220 or transmits the encoded image to othermodules or external devices through the communication unit 250 in step1223. The image processing operation is repeated until the image hasbeen processed or a user's request for terminating the image process ismade. When the controller 210 detects an image process termination instep 1225, the controller 210 terminates the image processing procedure.

The controller 210 determines a pixel pattern corresponding to outlinesor boundaries of an object in the image, and creates an encoded image ofcolor difference data encoded according to the determined pixel pattern.When the controller 210 decodes the encoded image, the controller 210verifies a pixel pattern according to flag data and decodes the pixelsaccording to the verified pixel pattern.

FIG. 16 illustrates a method of encoding images and decoding encodedimages, according to pixel patterns, in an electronic device accordingto various embodiments of the present invention.

Referring to FIG. 16, when a function for encoding YCbCr image isexecuted, the controller 210 detects the encoding function in step 1611and encodes a color image in step 1613. The process of encoding a colorimage in step 1613 may be performed according to the procedure shown inFIG. 12.

When a function of displaying the encoded image, the controller 210detects the displaying function in step 1651, accesses an encoded imageof one of the structures shown in FIGS. 9A to 9C in step 1653, verifiespattern flag to verify a pixel pattern in step 1655, and decodes theimage according to the verified pixel pattern in step 1657.

FIG. 17 illustrates a method of decoding a encoded image in anelectronic device according to various embodiments of the presentinvention.

Referring to FIG. 17, the controller 210 determines a pixel pattern of aunit block corresponding to the flag data in step 1711, restores Cba−Cbdpixels by using CB1 and CB2 according to the verified pixel pattern instep 1713, and Cra−Crd pixels by using CR1 and CR2 according to theverified pixel pattern in step 1715. The controller 210 creates Ya−Yd ofa unit block, decoded Cba−Cbd and Cra−Crd pixels in step 1717.

Referring back to FIG. 16, the controller 210 restores the colordifference data of 2 pixels, decoded in step 1657, to color differencedata of 4 pixels corresponding to a pixel pattern. For example, for anencoded image of pattern 0, the controller 210 restores Cba and Cbbpixels to CB1 data, Cbc and Cbd pixels to CB2 data, Cra and Crb pixelsto CR1 data, and Crc and Crd pixels to CR2 data, in step 1657. Inaddition, for an encoded image of pattern 1, the controller 210 restoresCba and Cbc pixels to CB1 data, Cbb and Cbd pixels to CB2 data, Cra andCrc pixels to CR1 data, and Crb and Crd pixels to CR2 data.

When the display 230 displays RGB images, the controller 210 detects thedisplayed image in step 1659, performs color conversion for the YCbCrimage by a method expressed by Equation (3), and displays the decodedYCbCr image on the display 230 in step 1663. When the controller 210detects a termination in step 1665, the controller 210 terminates theencoding and decoding procedure.

FIGS. 18A and 18B illustrate images encoded according to pixel patternsin an electronic device, by comparison with each other, according tovarious embodiments of the present invention. Referring to FIGS. 18A to18C, the images indicated by reference numerals 1811, 1831 and 1851 areexamples of an original image, images 1813, 1833 and 1853 are examplesof a conventional YCbCR 422 image of color resolution 4:2:2, and images1815, 1835 and 1855 are examples of an enhanced YCbCr 422 image as colordifference data is encoded according to a pixel pattern. The enhancedYCbCr images 1815, 1835 and 1855 display objects with sharper boundariesand outlines than conventional YCbCR 422 images 1813, 1833 and 1853.

A method of processing images in an electronic device according tovarious embodiments of the present invention includes analyzing pixeldata of an image and outputting the analyzed pixel data, determining apixel pattern based on the analyzed pixel data, and encoding the imageaccording to the determined pixel pattern.

The analyzed pixel data includes at least one of luminance data, firstcolor difference data and second color difference data. The first colordifference data is Cb. The second color difference data is Cr.

When the image is RGB data, the image processing method converts colorsfrom the RGB data to YCbCr data.

The output of the analyzed pixel data includes selecting luminancepixels of a unit block, Ya and Yd, obtaining absolute values Abs(Ya−Yb), Abs (Yc−Yd), Abs (Ya−Yc), Abs (Yb−Yd), Abs (Ya−Yd) and Abs(Yb−Yc) from the Ya−Yd pixels, and comparing the absolute values with athreshold and outputting the analyzed pixel data.

The determination of a pixel pattern includes analyzing the analyzedpixel data and determining the pixel pattern, and outputting flag dataaccording to the determined pixel pattern.

The process of encoding the image includes encoding CB by calculating anaverage of Cb pixels corresponding to a combination of pixels less thanthe threshold according to the determined pixel pattern, and creatingfirst encoded data CB1 and second encoded data CB2, encoding Cr bycalculating an average of Cr pixels corresponding to a combination ofpixels less than the threshold according to the determined pixelpattern, and creating first encoded data CR1 and second encoded dataCR2, inserting the flag data to CB1−CB2 and CR1−CR2, and creatingencoded data by combining Ya−Yd, CB1, CB2, CR1 and CR2 and flag data.The process of inserting the flag data includes inserting the flag datato the LSB of CB1, CB2, CR1 and CR2.

An image processing method according to various embodiments of thepresent invention further includes analyzing, when displaying an image,flag data in an encoded image and verifying a pattern, and decodingfirst color difference data and second color difference data accordingto the verified pattern.

The image processing method further includes displaying the decodedimage by converting, when the display is an RGB display, the decodedluminance data, first color difference data and second color differencedata, to RGB data.

As described above, the electronic device according to variousembodiments of the present invention analyzes, when processing a colorimage, pixel values of the color image, determines the pixel pattern,and encodes the color difference data according to the determined pixelpattern. The electronic device detects a pixel pattern that differs fromthe pixel pattern according to the outline or boundary of image anddisplays the encoded image with a clear boundary or outline.

In the embodiments of the present invention, the terminology ‘˜module’refers to a ‘unit’ including hardware, software, firmware or acombination thereof. For example, the terminology ‘˜module’ isinterchangeable with ‘˜unit,’ ‘˜logic,’ ‘˜logical block,’ ‘˜component,’‘˜circuit,’ etc. A ‘module’ may be the least unit or a part of anintegrated component. A ‘module’ may be the least unit or a part thereofthat can perform one or more functions. A ‘module’ may be implemented inmechanical or electronic mode. For example, ‘modules’ according to theembodiments of the present invention may be implemented with at leastone of an Application Specific Integrated Circuit (ASIC) chip,Field-Programmable Gate Arrays (FPGAs) and a programmable-logic devicethat can perform functions that have been known or will be developed.

At least part of the programming module 300 may be implemented byinstructions stored in computer-readable storage media. If theinstructions are executed by one or more processors, the processors canperform the functions respectively. An example of the computer-readablestorage media may be a memory 220. At least part of the programmingmodule may be implemented by the processor 210. At least part of theprogramming module may include module, programs, routines, sets ofinstructions and/or processes, in order to perform one or morefunctions.

Examples of computer-readable media include: magnetic media, such ashard disks, floppy disks, and magnetic tape, optical media such asCD-ROM disks and DVDs; magneto-optical media, such as floptical disks,and hardware devices that are specially configured to store and performprogram instructions (programming modules), such as ROM, RAM, and flashmemory. Examples of program instructions include machine code, such asproduced by a compiler, and files containing higher level code that maybe executed by the computer using an interpreter. The described hardwaredevices may be configured to act as one or more software modules inorder to perform the operations and methods described above, or viceversa.

Modules or programming modules according to the present invention mayinclude one or more components described above, remove part of thecomponents described above, or include new components. The operationsperformed by modules, programming modules, or the other components,according to the present invention, may be executed in serial, parallel,repetitive or heuristic fashion. Part of the operations can be executedin any other order, skipped, or executed with additional operations.

Although certain embodiments of the invention have been described indetail above, it should be understood that many variations andmodifications of the basic inventive concept herein described, which maybe apparent to those skilled in the art, will still fall within thespirit and scope of the embodiments of the invention as defined in theappended claims.

What is claimed is:
 1. An electronic device comprising: a display thatdisplays the image, and one or more processor functionally connected tothe display and configured to encode the image and to decode the image,wherein encoding the image by the one or more processor comprises:determining a pixel pattern by analyzing luminance data of pixels in aunit block of the image, encoding the image by using the luminance dataand at least one color difference data of the pixels in the unit block,wherein the at least one color difference data is generated based on acolor value of at least two pixels selected based on the determinedpixel pattern.
 2. The electronic device of claim 1, wherein: pixel dataof pixels of the image comprises the luminance data and at least onecolor value; and wherein encoding the image further comprises removingthe at least one color value and adding the at least one colordifference data.
 3. The electronic device of claim 1, wherein at leastone color value comprises blue difference chroma component Cb and reddifference chroma component Cr.
 4. The electronic device of claim 1,wherein the one or more processor comprises: a pixel analysis unit thatanalyzes luminance data of the unit block and outputs the analyzed pixeldata; a pattern determining unit that determines a pixel patterncorresponding to the analyzed pixel data and outputs flag data of thedetermined pixel pattern; and an encoding unit that generates the atleast one color difference data based on the color value of the at leasttwo pixels selected based on the determined pixel pattern, and createsencoded data including the flag data, the luminance data, and thegenerated at least one color difference data.
 5. The electronic deviceof claim 1, wherein the one or more processor is configured to convert,when the image is Red, Green, Blue (RGB) data, colors from the RGB datato YCbCr data.
 6. The electronic device of claim 3, wherein the one ormore processor is configured to: calculate absolute values Abs (Ya−Yb),Abs (Yc−Yd), Abs (Ya−Yc), Abs (Yb−Yd), Abs (Ya−Yd), and Abs (Yb−Yc),wherein the Ya is luminance data of a first pixel of the unit block, theYb is luminance data of a second pixel of the unit block, the Yc isluminance data of a third pixel of the unit block, and the Yd isluminance data of a fourth pixel of the unit block; and compare theabsolute values with a threshold; and output analyzed pixel data.
 7. Theelectronic device of claim 1, wherein the one or more processor isconfigured to generate flag data according to the determined pixelpattern.
 8. The electronic device of claim 6, wherein encoding the imagecomprises: calculating an average of Cb of pixels corresponding to acombination of pixels less than a threshold according to the determinedpixel pattern, and creating first encoded data CB1 and second encodeddata CB2; calculating an average of Cr of pixels corresponding to thecombination of pixels less than the threshold according to thedetermined pixel pattern, and creating first encoded data CR1 and secondencoded data CR2; and combining the Ya, the Yb, the Yc, the Yd, the CB1,the CB2, the CR1 and the CR2 and flag data to create combined encodeddata.
 9. The electronic device of claim 8, wherein the one or moreprocessor is configured to insert the flag data to a Least SignificantBit (LSB) of the CB1, the CB2, the CR1, and the CR2.
 10. The electronicdevice of claim 1, wherein decoding the image by the one or moreprocessor comprises: analyzing, when displaying the image, flag data inan encoded image and verifying a pattern; and restoring at least onecolor value according to the verified pattern.
 11. The electronic deviceof claim 10, wherein the one or more processor is configured to:convert, when the display is a Red, Green, Blue (RGB) display, luminancedata and the at least one color value to the RGB data.
 12. A method ofprocessing images in an electronic device comprising: determining apixel pattern by analyzing luminance data of pixels in a unit block ofan image; and encoding the image by using the luminance data and atleast one color difference data of the pixels in the unit block, whereinthe at least one color difference data is generated based on a colorvalue of at least two pixels selected based on the determined pixelpattern.
 13. The method of claim 12, wherein pixel data of pixels of theimage comprises at least one of the luminance data and at least onecolor value.
 14. The method of claim 12, wherein: at least one colorvalue comprises blue difference chroma component Cb and red differencechroma component Cr.
 15. The method of claim 12, further comprising:converting, when the image is Red, Green, Blue (RGB) data, colors fromthe RGB data to YCbCr data.
 16. The method of claim 14, whereinoutputting the analyzed pixel data comprises: obtaining absolute valuesAbs (Ya−Yb), Abs (Yc−Yd), Abs (Ya−Yc), Abs (Yb−Yd), Abs (Ya−Yd), and Abs(Yb−Yc), wherein the Ya is luminance data of a first pixel of the unitblock, the Yb is luminance data of a second pixel of the unit block, theYc is luminance data of a third pixel of the unit block, and the Yd isluminance data of a fourth pixel of the unit block; and comparing theabsolute values with a threshold and outputting the analyzed pixel data.17. The method of claim 12, wherein determining the pixel patterncomprises: generating flag data according to the determined pixelpattern.
 18. The method of claim 12, wherein encoding the imagecomprises: calculating an average of Cb of pixels corresponding to acombination of pixels less than a threshold according to the determinedpixel pattern, and creating first encoded data CB1 and second encodeddata CB2; encoding second data by calculating an average of Cr of pixelscorresponding to the combination of pixels less than the thresholdaccording to the determined pixel pattern, and creating first encodeddata CR1 and second encoded data CR2; and combining Ya, Yb, Yc, Yd, theCB1, the CB2, the CR1 and the CR2 and flag data.
 19. The method of claim18, wherein the flag data is inserted to a Least Significant Bit (LSB)of the CB1, the CB2, the CR1, and the CR2.
 20. The method of claim 12,further comprising: analyzing, when displaying the image, flag data inan encoded image and verifying a pattern; and decoding at least onecolor value according to the verified pattern.
 21. The method of claim20, further comprising: displaying the decoded image by converting, whenthe display is a Red, Green, Blue (RGB) display, the decoded luminancedata and the at least one color value to RGB data.